#include<bits/stdc++.h>
using namespace std;
int vis[100005],r[100005];
int n,ans; 
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>r[i];
	}
	sort(r+1,r+n+1);
	int ma=r[n];
	for(int i=1;i<=n;i++){
		if(r[i]==ma)break;
		int pos=upper_bound(r+1,r+n+1,r[i])-r;
		int flag=0;
		while(vis[pos]){
			pos++;
			if(pos>n)flag=1;
		}
		if(flag)break;
		ans++;
		vis[pos]=1;
	}
	cout<<n-ans;
	return 0;
}
